<?php

class AnswerController extends AuthController {
	private $DB;
	public function __Init(){
		$this->DB = new AnswerModel;
	}
	// 获取回答有关的信息
	public function allAnswer(){
		// 执行获取所有答案动作
		$Field = $this->DB->AllAnswer();
		// 得到所有答案列表
		$this->assign('info',$Field['Ans']);
		// 得到分页信息
		$this->assign('Pages',$Field['Pages']);
		// 得到答案条数
		$this->assign('count',$Field['count']);
		$this->display('allAnswer.html');
	}
	// 未采纳回答
	public function noAcceptAnswer(){
		// 获取未采纳答案列表
		$Field = $this->DB->NoAcceptAnswer();
		// 分配未采纳答案列表
		$this->assign('ansList',$Field['Field']);
		$this->assign('Pages',$Field['Pages']);
		$this->assign('count',$Field['count']);
		$this->display('noAcceptAnswer.html');
	}
	// 已采纳回答
	public function acceptAnswer(){
		// 已采纳答案相关的记录
		$Field = $this->DB->AcceptAnswer();
		// 已采纳答案记录数
		$this->assign('count',$Field['count']);
		// 页码相关信息
		$this->assign('Pages',$Field['Pages']);
		// 已采纳答案列表
		$this->assign('Field',$Field['Field']);
		$this->display('acceptAnswer.html');
	}

}


?>